Object and Type
Object : FCApplication
Type : Method
Prototype
Public Function GetHgbstElmDefault(ByVal ListName As String,
Optional ByVal Element1 As String = "", Optional ByVal Element2 As String = "", Optional ByVal Element3 As String = "", Optional ByVal Element4 As String = "") As String
Description
This method returns the hgbst_elm.title for the default element in a given level of a user-defined list. You may use up to a 5-level list. If an default element has not been defined, then the first element is returned. The hgbst tables are cached in the FCApplication object, so this method does not cause a database round-trip.
Parameters
Parameter Name Required? Description
ListName Yes The user-defined list name.
Element1 No The parent element for TheElement, if TheElement is in a 2
level list. Else, the parent element for Element2.
Element2 No The parent element for TheElement, if TheElement is in a 3
level list. Else, the parent element for Element3.
Element3 No The parent element for TheElement, if TheElement is in a 4
level list. Else, the parent element for Element4.
Element4 No The parent element for TheElement, if TheElement is in a 5
level list.
Returns
The hgbst_elm.title string for the default element in a given level of a user-defined list. If the list for this level is empty, "" (empty string) is returned.
Error Codes
Value Meaning
10008 ListName must not be empty.
10009 Invalid ListName.
Example
The following example displays the Family:Software user-defined list, and sets the default value to be selected.
JavaScript:
The code in this example is written in JavaScript for inclusion in ASP pages.
FAMILY:SOFTWARE:
<SELECT NAME="FAMILY2">
<%
var def = FCApp.GetHgbstElmDefault("FAMILY","Software");
var TheList = FCApp.GetHgbstList("FAMILY","Software");
while (! TheList.EOF) { %>
<option
<% if (TheList("title") == def) { %>
selected = true <% } %> >
<%=TheList("title")%>
<% TheList.MoveNext; %>
</option>
<% } %>
</SELECT>
<%
TheList.Close();
%>}